#!/bin/bash

# ----------------------------------------------------------------------
# Filename:   75676-auditctl-D.sh
# Version:    1.0
# Date:       2013/12/12
# Author:     yuanhui.shi
# Email:      yuanhui.shi@cs2c.com.cn
# Summary:    03系统安全功能-02审计功能-01auditctl-06删除audit全部规则
# Notes:      auditctl -D
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/12/12
#             -   The first one
# ----------------------------------------------------------------------

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../../lib/Echo.sh
source ./lib/cmd.sh
source ../../../lib/XmlParse.sh


function CleanData ()
{
  auditctl -D &>/dev/null
  EchoInfo "75676-auditctl-D.sh执行完毕"
}

trap "CleanData" EXIT

auditctl -a entry,always -S open -F uid=501 &>/dev/null
[ -n "`auditctl -l |grep LIST_RULES`" ] 
echo "系统内现有规则不为空"

auditctl -D &>/dev/null
[ -z "`auditctl -l |grep LIST_RULES`" ]
EchoResult "运用命令成功删除所有规则"
